<template>
  <div>
    <test></test>
    <client-only>
      <vue-editor v-model="content" :editorToolbar="customToolbar"></vue-editor>
    </client-only>
  </div>
</template>
<script>
import test from "@/components/hotel/test.vue";

export default {
  components: {
    test
  },
  data() {
    return {
      content: " <h1>编辑器HTML </ h1>",
      customToolbar: [
        ["bold", "italic", "underline"],
        [{ list: "ordered" }, { list: "bullet" }],
        ["image", "code-block"]
      ]
    };
  },
  mounted() {
    this.getPostList();
  },
  methods: {
    getPostList() {
      this.$axios({
        url: "/posts",
        method: "get",
        params: {
          city: "北京",
          _start: 0,
          _limit: 3
        }
      }).then(res => {
        console.log("文章列表", res);
      });
    }
  }
};
</script>
<style lang="less" scoped>
// .vue-editor {
//   width: 800px;
//   height: 400px;
// }
</style>
